import React from 'react';
import { Modal, Button } from 'choerodon-ui/pro';
import ModalDetail from './ModalDetail';

const modalKey = Modal.key();

const ModalConfirm: React.FC = () => {
  const openModal = () => {
    Modal.confirm({
      key: modalKey,
      title: '提示',
      children: <ModalDetail />,
      okText: '确定',
    })
    .then((type: string) => {
      Modal.info(`Click ${type}`);
    });
  };

  return (
    <Button onClick={openModal}>
      Open
    </Button>
  );
};

export default ModalConfirm;